package com.ruoyi.system.quartz;
import javax.servlet.http.HttpServletRequest;

import org.jsoup.Connection.Request;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import com.ruoyi.common.utils.AddressUtils;
import com.ruoyi.system.service.IHatchetMerchantService;
import com.ruoyi.system.service.INewsService;

/**
 * 定时任务调度测试
 * 
 * @author ruoyi
 */
@Component("systemTask")
public class SystemTask{
	@Autowired
	private IHatchetMerchantService merchantService;
	@Autowired
	private INewsService newService;
	
    public void ryParams(String params){
        System.out.println("执行有参方法：" + params);
    }

    public void ryNoParams(){
        System.out.println("执行无参方法");
    }
    //每月1号零点清理用户的月贡献金额
    public void cleanMerMonMoney(){
    	merchantService.cleanMerMonMoney(AddressUtils.INCOME_DEFAULT);
    }
    
  //每两个小时刷新新闻
    public void flushNews() throws Exception{
    	newService.flushNews();
    }
    
}

